using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Goodscategory : IAccessible<T_Goodscategory, Goodscategory>, ILogicEntity<T_Goodscategory, Goodscategory>
    {
        public int ID { get; set; }

        public string CategoryName { get; set; }

        public int ParentId { get; set; }

        protected override void Covariant(T_Goodscategory model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.CategoryName = model.CategoryName;
                    this.ParentId = model.ParentId;
            }
}
        protected override T_Goodscategory Inverter(Goodscategory model)
        {
            if (model != null)
            {
                return new T_Goodscategory()
                {
                    ID = model.ID,
                    CategoryName = model.CategoryName,
                    ParentId = model.ParentId,
                };
            }
            return null;
        }
        public Goodscategory Set(T_Goodscategory dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
